import pymysql
from pymysql.cursors import DictCursor


def get_connection():
    con = pymysql.connect(host="localhost", user="19dsj",
                          password="123", db="19dsj_test", charset="utf8")
    return con

def get_dict_connection():
    #cursor的游标基于dict来处理
    con = pymysql.connect(host="localhost", user="19dsj",
                          password="123", db="19dsj_test", charset="utf8",cursorclass=DictCursor)
    return con